Optimal. Leaf size=65 \[ \frac{1}{2 f (a-b) \left (a+b \tan ^2(e+f x)\right )}-\frac{\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0723874, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3670, 444, 44} \[ \frac{1}{2 f (a-b) \left (a+b \tan ^2(e+f x)\right )}-\frac{\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3670
Rule 444
Rule 44
Rubi steps
\begin{align*} \int \frac{\tan (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x}{\left (1+x^2\right ) \left (a+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{(1+x) (a+b x)^2} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{1}{(a-b)^2 (1+x)}-\frac{b}{(a-b) (a+b x)^2}-\frac{b}{(a-b)^2 (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=-\frac{\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 (a-b)^2 f}+\frac{1}{2 (a-b) f \left (a+b \tan ^2(e+f x)\right )}\\ \end{align*}
Mathematica [A] time = 0.60227, size = 57, normalized size = 0.88 \[ -\frac{\frac{b-a}{a+b \tan ^2(e+f x)}+\log \left (a+b \tan ^2(e+f x)\right )+2 \log (\cos (e+f x))}{2 f (a-b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.024, size = 104, normalized size = 1.6 \begin{align*} -{\frac{\ln \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f \left ( a-b \right ) ^{2}}}+{\frac{a}{2\,f \left ( a-b \right ) ^{2} \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }}-{\frac{b}{2\,f \left ( a-b \right ) ^{2} \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f \left ( a-b \right ) ^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.10775, size = 119, normalized size = 1.83 \begin{align*} -\frac{\frac{b}{a^{3} - 2 \, a^{2} b + a b^{2} -{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \sin \left (f x + e\right )^{2}} + \frac{\log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{2} - 2 \, a b + b^{2}}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.13793, size = 235, normalized size = 3.62 \begin{align*} -\frac{b \tan \left (f x + e\right )^{2} +{\left (b \tan \left (f x + e\right )^{2} + a\right )} \log \left (\frac{b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right ) + b}{2 \,{\left ({\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} f \tan \left (f x + e\right )^{2} +{\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} f\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 48.2286, size = 816, normalized size = 12.55 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.39075, size = 413, normalized size = 6.35 \begin{align*} -\frac{\frac{\log \left (a + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{a^{2} - 2 \, a b + b^{2}} - \frac{2 \, \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right )}{a^{2} - 2 \, a b + b^{2}} - \frac{a^{2} + \frac{2 \, a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{4 \, b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}{{\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )}{\left (a + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]